package com.fulihui.weixinclient.request.order;

import com.fulihui.weixinclient.http.HttpMethodEnum;
import com.fulihui.weixinclient.result.order.UnifiedOrderWeixinResult;
import com.fulihui.weixinclient.util.XMLUtil;

/**
 * 微信支付接口请求参数
 * Created by Willard on 2015/9/17.
 */
public class UnifiedOrderWeixinRequest extends OrderWeixinRequest<UnifiedOrderWeixinResult> {
    private static final long serialVersionUID = -2217673181930909391L;

    /* 商品描述 Required */
    private String            body;

    /* 商品详情 */
    private String            detail;

    /* 附加数据 */
    private String            attach;

    /* 商户订单号 Required */
    private String            out_trade_no;

    /* 货币类型 */
    private String            fee_type;

    /* 总金额 Required */
    private int               total_fee;

    /* 终端IP Required */
    private String            spbill_create_ip;

    /* 交易起始时间 */
    private String            time_start;

    /* 交易结束时间 */
    private String            time_expire;

    /* 商品标记 */
    private String            goods_tag;

    /* 通知地址 Required */
    private String            notify_url;

    /* 交易类型 Required */
    private String            trade_type;

    /* 商品ID */
    private String            product_id;

    /* 指定支付方式 */
    private String            limit_pay;

    /* 用户标识 */
    private String            openid;

    @Override
    protected void childParam() {
    }

    @Override
    public String service() {
        return "https://api.mch.weixin.qq.com/pay/unifiedorder";
    }

    @Override
    public String urlEndStr() {
        return null;
    }

    @Override
    public UnifiedOrderWeixinResult parseResult(String respStr) {
        return XMLUtil.parseObject(respStr, UnifiedOrderWeixinResult.class);
    }

    @Override
    public HttpMethodEnum httpMethod() {
        return HttpMethodEnum.SSL_POST;
    }

    @Override
    public String requestData() {
        return XMLUtil.toXMLString(this);
    }

    public String getAppid() {
        return appid;
    }

    @Override
    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getAttach() {
        return attach;
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }

    public String getOut_trade_no() {
        return out_trade_no;
    }

    public void setOut_trade_no(String out_trade_no) {
        this.out_trade_no = out_trade_no;
    }

    public String getFee_type() {
        return fee_type;
    }

    public void setFee_type(String fee_type) {
        this.fee_type = fee_type;
    }

    public int getTotal_fee() {
        return total_fee;
    }

    public void setTotal_fee(int total_fee) {
        this.total_fee = total_fee;
    }

    public String getSpbill_create_ip() {
        return spbill_create_ip;
    }

    public void setSpbill_create_ip(String spbill_create_ip) {
        this.spbill_create_ip = spbill_create_ip;
    }

    public String getTime_start() {
        return time_start;
    }

    public void setTime_start(String time_start) {
        this.time_start = time_start;
    }

    public String getTime_expire() {
        return time_expire;
    }

    public void setTime_expire(String time_expire) {
        this.time_expire = time_expire;
    }

    public String getGoods_tag() {
        return goods_tag;
    }

    public void setGoods_tag(String goods_tag) {
        this.goods_tag = goods_tag;
    }

    public String getNotify_url() {
        return notify_url;
    }

    public void setNotify_url(String notify_url) {
        this.notify_url = notify_url;
    }

    public String getTrade_type() {
        return trade_type;
    }

    public void setTrade_type(String trade_type) {
        this.trade_type = trade_type;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

    public String getLimit_pay() {
        return limit_pay;
    }

    public void setLimit_pay(String limit_pay) {
        this.limit_pay = limit_pay;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }
}
